import {createRouter, createWebHashHistory, RouteRecordRaw} from "vue-router";
import otherRouter from "@/router/modules/other";
import baseRouter from "@/router/modules/base";
// import {useBaseStore} from "@/store";


// const baseStore = () => useBaseStore()

const routes: RouteRecordRaw[] = [...baseRouter, ...otherRouter]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

router.beforeEach((to, from, next) => {
    // baseStore().skeletonLoading = true
    next()
})

router.afterEach((to, from, failure) => {
    // setTimeout(() => {
    //     baseStore().skeletonLoading = false
    // }, 200)
    return true
})

export default router
